package javaRew;

/**
 * Created by xjweng on 2017/1/26.
 * 类和对象复习
 */
public class person {
    private String name; //默认初值null
    private int age = 0;

    //构造器，与类同名，没有返回值，没有void
    public person(){
        System.out.println("constructor start");
        this.age = 19;
        this.name = "FirstOne";
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        return;
        //无返回值函数，可return标识方法结束，return后面语句不执行
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void showOut(){
        System.out.println("resultShow： " + name);
    }
    public int add(int i, int j){
        return i + j;
    }
}
